<div navbar ng-init="currentItem='database'"></div>
<div ng-show="!loaded"><div loading></div></div>

<div id="main" ng-show="loaded" style="display:none">
	<div class="module-header">
		<h3>数据库管理</h3>
	</div>
	
	<div class="tabbable" ng-init="load()">
		<ul class="nav nav-tabs">
			<li ng-class="'active' | iftrue:activeTabName=='mysql'" ng-show="mysql_supported" style="display:none"><a href="#mysql" ng-click="sec('mysql')" data-toggle="tab">MySQL 数据库管理</a></li>
		</ul>
		<div class="tab-content">
			<div class="tab-pane" ng-class="'active' | iftrue:activeTabName=='mysql'" ng-show="mysql_supported" style="display:none" id="mysql">
				<div>
					<div style="height:50px">
						<div class="pull-left"><h5>MySQL 数据库管理</h5></div>
						<div class="pull-right"><a class="btn" href="#/site/nginx/new"><i class="icon-plus"></i> 新建数据库</a></div>
					</div>
					<table class="table table-hover table-button">
						<tbody>
							<tr>
								<th style="width:20px" class="td-right">#</th>
								<th style="width:120px">数据库名</th>
								<th>数据库用户</th>
								<th style="width:120px">操作</th>
							</tr>
							<tr ng-repeat="server in servers">
								<td class="td-right">{{$index+1}}</td>
								<td ng-bind-html-unsafe="server.status | site.status"></td>
								<td>
								</td>
								<td>
									<div class="btn-group">
										<button class="btn btn-small" ng-show="server.status!='on'" title="启用该站点" ng-click="nginx_enableserver(server.listens[0].ip, server.listens[0].port, server.server_names[0])">
											<i class="icon-play"></i>
										</button>
										<button class="btn btn-small" ng-show="server.status=='on'" title="停用该站点" ng-click="nginx_disableserver(server.listens[0].ip, server.listens[0].port, server.server_names[0])">
											<i class="icon-stop"></i>
										</button>
									</div>
								</td>
							</tr>
						</tbody>
					</table>
				</div>
			</div>
		</div>
	</div>

	<div ng-show="!has_dbserver" value="install" style="display:none">
		<div class="well" style="width:400px">
			<p>系统检测到您还未安装数据库服务器。</p>
			<p>请先安装 MySQL 数据库服务后继续操作。</p>
			<p style="padding-top:10px"><a class="btn" href="#/service?s=database">立即安装</a></p>
		</div>
	</div>
</div>
